Repository navigation
Modernize installation and audiobook generation - #17
Merged
Merged
Conversation
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
This was referenced Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fresh installations currently depend on unused DeepSpeed, Java/Tika and Qt packages, and chapter generation accumulates the entire waveform in memory. This change replaces the platform freezes with one
pyproject.tomlanduv.lock, streams audio to an atomic output file, and shares CPU/CUDA/MPS selection between the CLI and desktop app.uv run pdf-narrator; no separate DeepSpeed, Java, Qt or eSpeak NG installation is required. Kokoro uses the bundled eSpeak library.OUTPUT_DIR/chapters/for verified resume.Install
Install uv, clone this branch, and run from the repository:
uv run --locked pdf-narrator(MPS selected when available)uv run --locked pdf-narratoruv run --locked --no-default-groups --extra cuda pdf-narratorKeep the CUDA flags on subsequent
uv runcommands. The project selects Python 3.12. M4B needs FFmpeg on PATH. OCR additionally needs--extra ocr, Tesseract and Poppler; ordinary text extraction does not need these tools. No drivers or system software were changed on the Windows test laptop.Example:
uv run --locked pdf-narrator book.epub --voice ef_dora --format m4b --resume.Evidence
Three-platform CI run: all three platforms passed. CI runs with Hugging Face offline and does not download Kokoro weights. The separate Ubuntu job also passed real OCR on an image-only synthetic PDF (1 passed, Tesseract 5.3.4).
Windows used Python 3.12.12, uv 0.9.26, existing FFmpeg and driver 592.82: Torch 2.14.1+cpu and 2.11.0+cu128 in separate environments. CPU/CUDA synthesized 123.325 seconds of audio in 34.502/4.337 seconds; model load took 2.565/2.761 seconds. CUDA peaked at 994 MiB allocated and 1634 MiB reserved by PyTorch, below the laptop's 6 GiB. These counters exclude other processes and driver memory.
Single measurements, not a statistical study. Windows used the production CLI's extraction/cleaning with the same source text; Mac used the direct engine benchmark and produced 119.3 seconds. The speeds are not an identical-pipeline hardware comparison. Java and eSpeak were present on Windows; an isolated process succeeded without them on PATH and confirmed use of the bundled eSpeak DLL. DeepSpeed and Tika were absent from both app environments.
Writer memory
Same synthetic 20-minute waveform, separate processes, no TTS model:
Observed peak RSS fell about 63%, with more disk operations. This is a writer regression measurement, not a full-book memory guarantee.
Audio behavior changes: the writer clips each chunk and preserves Kokoro's amplitude instead of normalizing the whole chapter to its peak. Listening and the engine choice remain separate review decisions; this PR keeps Kokoro/Torch.
Related work
Addresses #1, #3, #8, #11, #12, #13.
This replaces the platform-specific dependency approach in #15. It incorporates the punctuation-only static safeguard identified by @Puddings22 in #16, without importing that PR's unrelated Linux requirements freeze. Neither existing PR nor any issue is closed by this change.
Not verified
Follow-ups
🤖 Generated with Codex